//
//  BaseNetworkRequest+GuangChi.m
//  ShiWuPai
//
//  Created by app on 16/11/28.
//  Copyright © 2016年 QQ:244987427. All rights reserved.
//

#import "BaseNetworkRequest+GuangChi.h"
#import "WHFeedInfor.h"
#import <YYModel.h>

#define NumberToString(Number) [NSString stringWithFormat:@"%@",@(Number)]
NSString *const kHomePagePath=@"feeds/category_feed";
@implementation BaseNetworkRequest (GuangChi)
+(void)getFeedInfoWithPage:(int)page CateGory:(int)category success:(void(^)(id responseObj,NSError *error))completionHandler{
    
    NSDictionary *ParameterDic=@{
                                 @"page":NumberToString(page),
                                 @"category":NumberToString(category)
                                 };
    [self rquestWithType:@"GET" Path:kHomePagePath Parameters:ParameterDic success:^(id responseObj, NSError *error) {
        if (!error) {
            WHFeedInfor *feedInfo=[WHFeedInfor yy_modelWithJSON:responseObj];
            completionHandler(feedInfo,nil);
        }
        else{
            completionHandler(nil,error);
        }
    }];
}
@end
